package org.lanqiao.tjut.control;

import java.util.List;

import org.lanqiao.tjut.bean.UsersEntity;
import org.lanqiao.tjut.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
@RestController("userControl")
public class UserInfoControl {

	// 依赖注入，面向接口编程
	@Autowired
	private IUserService userService;

	/**
	 * 插叙所有的用户信息
	 * 
	 * @return 用户信息集合
	 */
	public List<UsersEntity> selectAllUsersInfo() {
		// 调用dao层完成数据库查询操作
		List<UsersEntity> lstUsers = userService.selectAllUsersInfo();
		// 打印用户信息
		for (UsersEntity usersE : lstUsers) {
			System.out.println(usersE.toString());
		}
		return lstUsers;
	}
}
